package com.wallet;

public class wallet {
    private double remain;
    wallet(){
        remain = 0;
    }
    public double getRemain(){
        return this.remain;
    }
    public void showRemain(){
        System.out.println("目前的余额为"+this.remain);
    }

    public void getDeposit(double n){
        //从银行获取的钱数，不管银行，只管钱包加钱,提现同理。
        if(n<=0){
            System.out.println("非法参数传入");
            return;
        }
        remain += n;
    }
    public void CashOut(double n){
        if(n<=0){
            System.out.println("非法参数传入");
            return;
        }
        remain -= n;
    }
}
